//路由文件
app.config(function($stateProvider,$urlRouterProvider){
	$stateProvider.state("home",{    
		url:"/home",
		cache:false,
		 controller:"home",
		templateUrl:"template/home.html",
	    resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/home.js"]);
                }]
     }
	}).state("login",{    
		url:"/login",
		cache:false,
		 controller:"login",
		templateUrl:"template/login.html",
	    resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/login.js"]);
                }]
     }
	}).state("home.staff",{
		url:"/staff",
	  params:{page:null},
	  templateUrl:"template/staff/staff.html",
	  controller:"staff",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/staff/staff.js"]);
                }]
     }
	}).state("home.census",{
		url:"/census",
	  params:{page:null},
	  templateUrl:"template/staff/census.html",
	  controller:"census",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/staff/census.js","config/compentHome.js"]);
                }]
     }
	})
	
	
	
	
	.state("home.addStaff",{
		url:"/addStaff",
	  templateUrl:"template/staff/addStaff.html",
	  controller:"addStaff",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/staff/addStaff.js"]);
                }]
     }
	}).state("home.role",{
	  url:"/role",
	  templateUrl:"template/system/role.html",
	  controller:"role",
	  cache:false,
	  resolve:{
	    deps:["$ocLazyLoad",function($ocLazyLoad){
	        return $ocLazyLoad.load(["controller/system/role.js"]);
	  }]
     }
	}).state("home.roleAdd",{
	  url:"/roleAdd/:id",
	  templateUrl:"template/system/roleAdd.html",
	  controller:"roleAdd",
	  cache:false,
	  resolve:{
	    deps:["$ocLazyLoad",function($ocLazyLoad){
	        return $ocLazyLoad.load(["controller/system/roleAdd.js"]);
	  }]
     }
	})
	.state("home.contact",{
	  url:"/contact",
	  templateUrl:"template/contact/contact.html",
	  controller:"contact",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/contact/contact.js"]);
	            }]
     }
	}).state("home.addupdate",{
	  url:"/addupdate/:id/:page/:url",
	  templateUrl:"template/staff/addupdate.html",
	  controller:"addupdate",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/staff/addupdate.js","config/compent.js"]);
	            }]
     }
	}).state("home.kmtj",{
	  url:"/kmtj",
	  templateUrl:"template/contact/kmtj.html",
	  controller:"kmtj",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/contact/kmtj.js"]);
	            }]
     }
	}).state("home.jytj",{
	  url:"/jytj",
	   params:{year:null},
	  templateUrl:"template/contact/jytj.html",
	  controller:"jytj",
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/contact/jytj.js"]);
	            }]
     }
	}).state("home.column",{
	  url:"/column",
	  templateUrl:"template/system/column.html",
	  controller:"column",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/system/column.js"]);
	            }]
     }
	}).state("home.user",{
	  url:"/user",
	  templateUrl:"template/system/user.html",
	  controller:"user",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/system/user.js"]);
	            }]
     }
	}).state("home.userUpd",{
	  url:"/userUpd/:id",
	  templateUrl:"template/system/userUpd.html",
	  controller:"userUpd",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/system/userUpd.js"]);
	            }]
     }
	}).state("home.service",{
	  url:"/service",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	})
	.state("home.professional",{
	  url:"/professional",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	})
	.state("home.payment",{
	  url:"/payment",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	}).state("home.subject",{
	  url:"/subject",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	}).state("home.companyType",{
	  url:"/companyType",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	   
	}).state("home.importance",{
	  url:"/importance",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	   
	})
	.state("home.supCompanyType",{
	  url:"/supCompanyType",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	})
	.state("home.post",{
	  url:"/post",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	})
	.state("home.contactType",{
	  url:"/contactType",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	})
	.state("home.character",{
	  url:"/character",
	  templateUrl:"template/dictionary/dictionary.html",
	  controller:"dictionary",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionary.js"]);
	            }]
     }
	}).state("home.projectType",{
	  url:"/projectType",
	  templateUrl:"template/dictionary/dictionaryProject.html",
	  controller:"dictionaryProject",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionaryProject.js"]);
	            }]
     }
	}).state("home.projectState",{
	  url:"/projectState/:code/:name",
	  templateUrl:"template/dictionary/dictionaryProject.html",
	  controller:"dictionaryProject",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/dictionary/dictionaryProject.js"]);
	            }]
     }
	})
	.state("home.structure",{
	  url:"/structure",
	    params:{page:null},
	  templateUrl:"template/staff/structure.html",
	  controller:"structure",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/staff/structure.js"]);
	            }]
     }
	}).state("home.project",{
	  url:"/project",
	    params:{page:null},
	  templateUrl:"template/project/project.html",
	  controller:"project",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/project/project.js"]);
	            }]
     }
	})
	
	.state("home.proUpdate",{
	  url:"/proUpdate/:id/:page/:url",
	  templateUrl:"template/project/addupdate.html",
	  controller:"addupdatep",
	   cache:false,
	   resolve:{
	            deps:["$ocLazyLoad",function($ocLazyLoad){
	                return $ocLazyLoad.load(["controller/project/addupdate.js","config/compent.js"]);
	            }]
     }
	})
	.state("home.fee",{
		url:"/fee",
	  params:{page:null},
	  templateUrl:"template/fee/fee/fee.html",
	  controller:"fee",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/fee/fee.js"]);
                }]
     }
	})
	.state("home.feeSubject",{
		url:"/feeSubject",
	  params:{page:null},
	  templateUrl:"template/fee/fee/subject.html",
	  controller:"subject",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/fee/subject.js"]);
                }]
     }
	})
	.state("home.feeAdd",{
	 url:"/feeAdd/:id/:page/:url",
	  templateUrl:"template/fee/fee/addupdate.html",
	  controller:"addupdateFee",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/fee/addupdate.js","config/compent.js"]);
                }]
     }
	})
	.state("home.feeProject",{
		url:"/feeProject",
	  params:{page:null},
	  templateUrl:"template/fee/fee/project.html",
	  controller:"project",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/fee/project.js"]);
                }]
     }
	})
	.state("home.reimburse",{
		url:"/reimburse",
	  params:{page:null},
	  templateUrl:"template/fee/reimburse/reimburse.html",
	  controller:"reimburse",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/reimburse/reimburse.js"]);
                }]
     }
	}).state("home.reimburseSubject",{
		url:"/reimburseSubject",
	  params:{page:null},
	  templateUrl:"template/fee/reimburse/subject.html",
	  controller:"subject",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/reimburse/subject.js"]);
                }]
     }
	}).state("home.reimburseAdd",{
	 url:"/reimburseAdd/:id/:page/:url",
	  templateUrl:"template/fee/reimburse/addupdate.html",
	  controller:"reimburseAdd",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/reimburse/addupdate.js","config/compent.js"]);
                }]
     }
	})
	.state("home.other",{
		url:"/other",
	  params:{page:null},
	  templateUrl:"template/fee/other/other.html",
	  controller:"other",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/other/other.js"]);
                }]
     }
	}).state("home.otherAdd",{
	 url:"/otherAdd/:id/:page/:url",
	  templateUrl:"template/fee/other/addupdate.html",
	  controller:"otherAdd",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/other/addupdate.js","config/compent.js"]);
                }]
     }
	})
	.state("home.income",{
		url:"/income",
	  params:{page:null},
	  templateUrl:"template/fee/income/income.html",
	  controller:"income",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/income/income.js"]);
                }]
     }
	})
	.state("home.incomeAdd",{
	 url:"/incomeAdd/:id/:page/:url",
	  templateUrl:"template/fee/income/addupdate.html",
	  controller:"incomeAdd",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/fee/income/addupdate.js","config/compent.js"]);
                }]
     }
	})
	.state("home.company",{
		url:"/company",
	  params:{page:null},
	  templateUrl:"template/sale/company/company.html",
	  controller:"company",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/company/company.js"]);
                }]
     }
	})
	.state("home.customer",{
		url:"/customer",
	  params:{page:null},
	  templateUrl:"template/sale/customer/customer.html",
	  controller:"customer",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/customer/customer.js"]);
                }]
     }
	}).state("home.customerAdd",{
	 url:"/customerAdd/:id/:page/:url",
	  templateUrl:"template/sale/customer/addupdate.html",
	  controller:"customerAdd",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/customer/addupdate.js","config/compent.js"]);
                }]
     }
	})
	.state("home.sale",{
		url:"/sale",
	  params:{page:null},
	  templateUrl:"template/sale/sale/sale.html",
	  controller:"sale",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/sale/sale.js"]);
                }]
     }
	})
	.state("home.saleAdd",{
	 url:"/saleAdd/:id/:page/:url",
	  templateUrl:"template/sale/sale/addupdate.html",
	  controller:"addupdateSale",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/sale/addupdate.js","config/compent.js"]);
                }]
     }
	}).state("home.purchase",{
		url:"/purchase",
	  params:{page:null},
	  templateUrl:"template/purchase/purchase/purchase.html",
	  controller:"purchase",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/purchase/purchase/purchase.js"]);
                }]
     }
	})
	.state("home.purchaseAdd",{
	 url:"/purchaseAdd/:id/:page/:url",
	  templateUrl:"template/purchase/purchase/addupdate.html",
	  controller:"purchaseAdd",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/purchase/purchase/addupdate.js","config/compent.js"]);
                }]
     }
	})
	
	.state("home.contractPay",{
		url:"/contractPay/:cid/:page/:url",
	  params:{page:null},
	  templateUrl:"template/sale/sale/contractPay.html",
	  controller:"contractPay",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/sale/contractPay.js"]);
                }]
     }
	}).state("home.invoiceSale",{
		url:"/invoiceSale/:cid/:page/:url",
	  params:{page:null},
	  templateUrl:"template/sale/sale/invoiceSale.html",
	  controller:"invoiceSale",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/sale/sale/invoiceSale.js"]);
                }]
     }
	})
	.state("home.supplier",{
		url:"/supplier",
	  params:{page:null},
	  templateUrl:"template/purchase/supplier/supplier.html",
	  controller:"supplier",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/purchase/supplier/supplier.js"]);
                }]
     }
	}).state("home.projectCost",{
		url:"/projectCost",
	  params:{page:null},
	  templateUrl:"template/statistical/projectCost.html",
	  controller:"projectCost",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/statistical/projectCost.js"]);
                }]
     }
	}).state("home.projectDetailed",{
		url:"/projectDetailed/:id/:page/:url",
	  params:{page:null},
	  templateUrl:"template/statistical/projectDetailed.html",
	  controller:"projectDetailed",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/statistical/projectDetailed.js"]);
                }]
     }
	}).state("home.contractPayPur",{
		url:"/contractPayPur/:cid/:page/:url",
	  params:{page:null},
	  templateUrl:"template/purchase/purchase/contractPay.html",
	  controller:"contractPayPur",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/purchase/purchase/contractPay.js"]);
                }]
     }
	}).state("home.invoicePur",{
		url:"/invoicePur/:cid/:page/:url",
	  params:{page:null},
	  templateUrl:"template/purchase/purchase/invoiceSale.html",
	  controller:"invoicePur",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/purchase/purchase/invoiceSale.js"]);
                }]
     }
	}).state("home.personnel",{
		url:"/personnel",
	  params:{page:null},
	  templateUrl:"template/personnel/personnel.html",
	  controller:"personnel",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/personnel/personnel.js"]);
                }]
     }
	})
	
	.state("home.workload",{
		url:"/workload",
	  params:{page:null},
	  templateUrl:"template/personnel/workload.html",
	  controller:"workload",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/personnel/workload.js"]);
                }]
     }
	})
	.state("home.departTasks",{
		url:"/departTasks",
	  params:{page:null},
	  templateUrl:"template/personnel/departTasks.html",
	  controller:"departTasks",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/personnel/departTasks.js"]);
                }]
     }
	}).state("home.wstatistics",{
		url:"/wstatistics",
	  params:{page:null},
	  templateUrl:"template/personnel/wstatistics.html",
	  controller:"wstatistics",
	  controllerAs:"ctrl",
	   cache:false,
	   resolve:{
                deps:["$ocLazyLoad",function($ocLazyLoad){
                    return $ocLazyLoad.load(["controller/personnel/wstatistics.js"]);
                }]
     }
	})
	var url=localStorage.getItem("page")
	if(url==null){
		$urlRouterProvider.otherwise("login")
	}else{
		$urlRouterProvider.otherwise(url.replace(".","/"))
	}
	
})
                